package com.itheima.tlias.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.tlias.mapper.LogMapper;
import com.itheima.tlias.service.LogService;
import com.itheima.tlias.pojo.OperationLog;
import com.itheima.tlias.pojo.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * TODO
 *
 * @Author mr.luo
 * @Date 12 4月 2025 19:52
 */
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogMapper logMapper;
    /**
     * 日志分页查询
     *
     * @param page
     * @param pageSize
     * @return
     */
    @Override
    public PageResult pageQuery(Integer page, Integer pageSize) {
        PageHelper.startPage(page, pageSize);
        Page<OperationLog> pageOperationLog = logMapper.pageQuery(page, pageSize);
       return new PageResult<>(pageOperationLog.getTotal(), pageOperationLog.getResult());
    }
}
